GBML manual / Tweens

tween_max

The most tweens that can glide at the same moment. Fixed when the game is built - it never changes while the game is running.

Works differently on Game Boy - The Game Boy glides up to 8 variables at once (the Advance 16), in 32 steps of the curve, over a distance of less than 1,024; a ninth jumps to its end value as the Advance's does when its places are full.

Works differently on Game Boy Color - The Game Boy Color glides up to 8 variables at once (the Advance 16), in 32 steps of the curve, over a distance of less than 1,024; a ninth jumps to its end value as the Advance's does when its places are full.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

tween_max() -> int

Returns

int

Description

The most glides that can run at the same moment: 16, unless your project changed Tweens gliding at once under Engine limits in Project Settings (1 to 64), and then it is the number you picked. It is fixed when the game is built and never changes while it runs.

Example

var spare = tween_max() - tween_count();

How many more glides could start right now. It is the same idea as instance_max and instance_count.

Good to know

On the GBA

The same kind of limit as instance_max. It is 16. A tween started when all the places are busy does not glide: its variable jumps to the end value and tween_to answers false (starting a tween on a variable that is already gliding takes over its place instead, so it never needs a new one). Asking for this number does not put the tween manager in your game; starting a tween does.

See also: tween_countTweenstween_toinstance_max